package org.dromara.fms.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.tenant.core.TenantEntity;

import java.io.Serial;
import java.util.Date;

/**
 * 财务单据对象 fms_bill
 *
 * @author wenrui Su
 * @date 2024-03-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("fms_bill")
public class FmsBill extends TenantEntity {

  @Serial
  private static final long serialVersionUID = 1L;

  @TableId(value = "id")
  private Long id;

  @ExcelProperty(value = "单据类型", converter = ExcelDictConvert.class)
  private Long typeId;

  @ExcelProperty(value = "账单名称", converter = ExcelDictConvert.class)
  private String name;

  @ExcelProperty(value = "记账项目", converter = ExcelDictConvert.class)
  private Long classificationItemId;

  @ExcelProperty(value = "来往单位", converter = ExcelDictConvert.class)
  private Long partnerId;

  @ExcelProperty(value = "单据编号", converter = ExcelDictConvert.class)
  private Long sourceId;

  @ExcelProperty(value = "操作员", converter = ExcelDictConvert.class)
  private Long operId;

  @ExcelProperty(value = "应收金额", converter = ExcelDictConvert.class)
  private double costMoney;

  @ExcelProperty(value = "实收金额", converter = ExcelDictConvert.class)
  private double money;

  @ExcelProperty(value = "账户", converter = ExcelDictConvert.class)
  private Long accountId;

  @ExcelProperty(value = "计划时间", converter = ExcelDictConvert.class)
  private Date planTime;

  @ExcelProperty(value = "执行时间", converter = ExcelDictConvert.class)
  private Date executionTime;

  @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
  @ExcelDictFormat(dictType = "fms_bill_status")
  private String status;

  @ExcelProperty(value = "备注", converter = ExcelDictConvert.class)
  private String remark;

  //    =========================================
  @JsonInclude(JsonInclude.Include.NON_EMPTY)
  @TableField(exist = false)
  private String typeName;

  @JsonInclude(JsonInclude.Include.NON_EMPTY)
  @TableField(exist = false)
  private String accountName;

  @JsonInclude(JsonInclude.Include.NON_EMPTY)
  @TableField(exist = false)
  private String partnerName;

  @JsonInclude(JsonInclude.Include.NON_EMPTY)
  @TableField(exist = false)
  private String operName;

  @JsonInclude(JsonInclude.Include.NON_EMPTY)
  @TableField(exist = false)
  private String classificationItemName;
}
